import sw from "element-ui/src/locale/lang/sw";

export default {
    data() {
        return {
           portfolioItems:  []
        }
    },
		
	mounted(){
		this.getAllImage()
	},
	methods:{
		getAllImage(){
			var that = this;
			that.$axios.get(this.$global.apiUrl+'record/getAll?userId='+this.$ls.get('userInfo').id)
			.then(res=>{
				var imageData = res.data.data;
				// console.log(imageData);
				that.portfolioItems = imageData.reverse()
				that.portfolioItems.forEach(item=>{
					switch (item.type) {
						case 'objectExtraction':
							item.typeZh='目标提取 '+item.type
							break
						case 'changeDetection':
							item.typeZh='变化检测 '+item.type
							break
						case 'objectDetection':
							item.typeZh='目标检测 '+item.type
							break
						case 'terrainClassification':
							item.typeZh='地物分类 '+item.type
							break
						default:break
					}
					item.time = item.time.replace('T',' ')
				})
			})
			.catch(function(error) {
				console.log(error);
			});
		}
	}
}